<?php

namespace backend\services\user;

use backend\extensions\ApiBaseService;
use backend\models\user\User;

/**
 * Desc 管理服务类
 * @author WMX
 */
class UserService extends ApiBaseService
{

    /**
     * 列表
     * @param array $params 参数 
     * **/
    public static function getList($params)
    {
        //检索条件
        $condition = ['AND'];
        if ($params['phone']) {
            $condition[] = ['=', 'phone', $params['phone']];
        }
        if ($params['name']) {
            $condition[] = ['like', 'name', $params['name']];
        }
        if ($params['date']) {
            $condition[] = ['>=', 'create_time', $params['date'][0]];
            $condition[] = ['<=', 'create_time', $params['date'][1]];
        }
        $list = User::getDataAll($condition, $params['page'], $params['page_size']);
        return $list;
    }

}
